home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / etc / init.d / autoconfig.z / autoconfig
Text File  |  1992-04-03  |  2KB  |  97 lines

  1. #!/bin/sh
  2. #Tag 0x00000800
  3.  
  4. # automatically re-configure the kernel
  5. # "$Revision: 1.19 $"
  6.  
  7.  
  8. LBOOTOPTS=
  9. FORCE="-t"
  10.  
  11. USAGE="`basename $0`: [-vf] [-p toolroot] [-d /usr/sysgen] [-o lbootopts] [start|stop]"
  12. while getopts "vfp:d:o:" c; do
  13.     case $c in
  14.     v) if test "$verbose" = "-v"; then
  15.         set -x
  16.     else
  17.         verbose="-v"
  18.         LBOOTOPTS="$LBOOTOPTS -v"
  19.     fi
  20.     ;;
  21.     f) FORCE=""
  22.        UNIX=${UNIX:=/unix.install};;
  23.     p) TOOLROOT="$OPTARG";;
  24.     d) SYSGEN="$OPTARG";;
  25.     o) LBOOTOPTS="$LBOOTOPTS $OPTARG";;
  26.     \?) echo $USAGE; exit 1;;
  27.     esac
  28. done
  29. shift `expr $OPTIND - 1`
  30.  
  31. SYSGEN=${SYSGEN:=/usr/sysgen}
  32. BOOTAREA=${BOOTAREA:=${SYSGEN}/boot}
  33. SYSTEM=${SYSTEM:=${SYSGEN}/system}
  34. MASTERD=${MASTERD:=${SYSGEN}/master.d}
  35. UNIX=${UNIX:=/unix}
  36.  
  37. # TOOLROOT and ROOT control where lboot looks for tools and does its work
  38. #   TOOLROOT is normally set in the system file.
  39. TOOLROOT=${TOOLROOT:=$SYSGEN/root}
  40. export TOOLROOT
  41.  
  42.  
  43. LBOOT=/usr/sbin/lboot
  44. SETSYM=/usr/sbin/setsym
  45.  
  46. LBOOTOPTS="$LBOOTOPTS $FORCE -m $MASTERD -b $BOOTAREA -s $SYSTEM -u $UNIX"
  47.  
  48. cd /
  49.  
  50.  
  51. case $1 in
  52.     ""|start)
  53.     for nm in $LBOOT $TOOLROOT/usr/bin/cc $TOOLROOT/usr/bin/ld; do
  54.         if test ! -x $nm; then
  55.         echo "`basename $0`: cannot find $nm" 1>&2
  56.         exit 1
  57.         fi
  58.     done
  59.     for nm in $BOOTAREA $MASTERD; do
  60.         if test ! -d $nm; then
  61.         echo "`basename $0`: cannot find $nm" 1>&2
  62.         exit 1
  63.         fi
  64.     done
  65.     for nm in $SYSTEM; do
  66.         if test ! -f $nm; then
  67.         echo "`basename $0`: cannot find $nm" 1>&2
  68.         exit 1
  69.         fi
  70.     done
  71.  
  72.     # note - set -e in a case stmt doesn't work right in /bin/sh
  73.     rm -rf ${UNIX}.install
  74.  
  75.     $LBOOT $LBOOTOPTS
  76.     if [ $? != 0 ]
  77.     then
  78.         # dont print anything since a no answer to Automatically ..
  79.         # causes lboot ot exit 1
  80.         exit 1
  81.     fi
  82.  
  83.     if test -x $SETSYM -a -w ${UNIX}.install; then
  84.         $SETSYM ${UNIX}.install
  85.     fi
  86.     ;;
  87.  
  88.     stop)
  89.     exit 1
  90.     ;;
  91.  
  92.     *)
  93.     echo "$USAGE"
  94.     exit 1
  95.     ;;
  96. esac
  97.